home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / mem / InstallIcon next >
Encoding:
Text File  |  1992-11-10  |  2.7 KB  |  98 lines  |  [TEXT/MPS ]

  1. #################################################################
  2. #                                #
  3. #  MPW Shell script to install the Icon Programming Language,    #
  4. #  MPW version.                            #
  5. #                                #
  6. #  To install Icon in your system, insert the MPWIcon disk into    #
  7. #  a disk drive and enter the command:                #
  8. #                                #
  9. #      MPWIcon:InstallIcon                    #
  10. #                                #
  11. #################################################################
  12.  
  13. Set Exit 0
  14. #
  15. #  Figure out the installation disk path.
  16. #
  17. (Evaluate "{0}" =~ /(≈:)®1[¬:]+/) > Dev:Null
  18. Set install "{®1}"
  19. Directory "{install}"
  20. Loop
  21.   If ¬("`Exists -d -q Icon`" && "`Exists -f -q UserStartup•Icon`")
  22.     Set install "`GetFileName -d -m -q "Where is ∂"MPW Icon∂" distribution disk?"`"
  23.     Exit if "{install}" == ""
  24.   Else
  25.     Break
  26.   End
  27. End
  28. #
  29. #  Select the folder for Icon installation.
  30. #
  31. Alert -s "Macintosh MPW Icon Language Installation∂n∂n ∂
  32. MPW Icon can be installed anywhere at all -- the standard ∂
  33. location is in a folder named Icon in your MPW folder."
  34. Set x "`GetListItem -q -m "Install Icon in:" ∂
  35.     "Existing Icon folder" "New Icon folder"`"
  36. Exit if "{x}" == ""
  37. If "{x}" == "Existing Icon folder"
  38.   If "{Icon}" != ""
  39.     Directory "{Icon}" ≥ Dev:Null
  40.     If {Status} != 0
  41.       If "`Exists -q "{MPW}Icon:"`"
  42.         Directory "{MPW}Icon:"
  43.       End
  44.     End
  45.   Else
  46.     Directory "{MPW}Icon:" ≥ Dev:Null
  47.   End
  48.   Set Icon "`GetFileName -q -m "Select ∂"Icon∂" folder" -d -b Install`"
  49.   Exit if "{Icon}" == ""
  50.   Directory "{Icon}"
  51.   #
  52.   #  Delete obsolete V7.0 files that won't be overwritten.
  53.   #
  54.   Delete -i itran ilink iconm iconx.hdr bin ≥ Dev:Null
  55. Else # New folder
  56.   Directory "{MPW}"
  57.   Set Icon "`GetFileName -p -q -m "Create ∂"Icon∂" folder" -b Install`"
  58.   Exit if "{Icon}" == ""
  59.   If "{Icon}" !~ /≈:/
  60.     Set Icon "{Icon}:"
  61.   End
  62.   Delete -i -y "{Icon}"
  63.   Exit 1 if {Status}
  64.   NewFolder "{Icon}"
  65.   Exit if {Status}
  66. End
  67. Echo "# Installing Icon from ∂"{install}∂" into ∂"{Icon}∂"".
  68. #
  69. #  Install the new stuff.
  70. #
  71. Directory "{install}Icon:"
  72. Duplicate -p -y icont iconx Icon.help IconMPWTool "{Icon}"
  73. Set x 0
  74. If "`Exists -q "{MPW}UserStartup•Icon"`"
  75.   Confirm "OK to overwrite {MPW}UserStartup•Icon?"
  76.   Set x {status}
  77. End
  78. If {x} == 0
  79.   Duplicate -p -y "{install}UserStartup•Icon" "{MPW}"
  80.   If "{Icon}" !~ /{MPW}Icon:/
  81.     Target "{MPW}UserStartup•Icon"
  82.     Find •
  83.     Find /•Set Icon /
  84.     Replace /∂{MPW∂}Icon:/ "`Files -i -f -q "{Icon}"`"
  85.     Close -y "{Target}"
  86.   End
  87. Else
  88.   Alert "Since you didn't install the UserStartup•Icon file, ∂
  89. don't forget to reinstall later, or manually add the necessary ∂
  90. commands to a UserStartup file."
  91. End
  92. Directory "{MPW}"
  93. Alert -s "Icon installation complete -- now quit and restart MPW Shell.∂
  94. ∂n## IMPORTANT ##∂nIf you are running ∂
  95. pre-3.0 MPW Shell, you must add ∂"Execute UserStartup•Icon∂" ∂
  96. to your UserStartup file."
  97. Exit 0
  98.